home *** CD-ROM | disk | FTP | other *** search
- on @ whichSprite
- if the type of sprite whichSprite = 0 then
- put "There is no sprite in channel " & whichSprite & "."
- else
- set item1 to "Sprite loc: " & point(the locH of sprite whichSprite, the locV of sprite whichSprite)
- set centerH to ((the right of sprite whichSprite - the left of sprite whichSprite) / 2) + the left of sprite whichSprite
- set centerV to ((the bottom of sprite whichSprite - the top of sprite whichSprite) / 2) + the top of sprite whichSprite
- set item2 to " Sprite center: " & point(centerH, centerV)
- put item1 & item2
- end if
- end
-
- on ? whichSprite
- if the type of sprite whichSprite = 0 then
- put "There is no sprite in channel " & whichSprite & "."
- else
- set whichCast to the castNum of sprite whichSprite
- set whichCastName to whichCast
- if the name of cast whichCast > 0 then
- set whichCastName to QUOTE & the name of cast whichCast & QUOTE
- end if
- set item1 to "Sprite: " & whichSprite & " Cast: " & whichCastName & " Type: " & the type of sprite whichSprite
- set item1 to item1 & ", " & the castType of cast whichCast
- set item2 to " Ink: " & the ink of sprite whichSprite
- set item3 to " Sprite loc: " & point(the locH of sprite whichSprite, the locV of sprite whichSprite)
- set item4 to " Top left corner: " & point(the left of sprite whichSprite, the top of sprite whichSprite)
- set item5 to " Bottom right corner: " & point(the right of sprite whichSprite, the bottom of sprite whichSprite)
- set item6 to " Stretch: " & the stretch of sprite whichSprite & " Cursor: " & the cursor of sprite whichSprite
- set item7 to RETURN & RETURN & "To activate sprite [ whichSprite ] , copy this into your script: "
- set item8 to "activate [ whichSprite ] , " & whichCastName & ", " & the type of sprite whichSprite & ", " & the ink of sprite whichSprite & ", "
- if the stretch of sprite whichSprite = 0 then
- set item9 to the locH of sprite whichSprite & ", " & the locV of sprite whichSprite & ", "
- set item9 to item9 & QUOTE & QUOTE & ", " & QUOTE & QUOTE & ", " & QUOTE
- else
- set item9 to the left of sprite whichSprite & ", " & the top of sprite whichSprite & ", " & QUOTE & "stretch to:" & QUOTE & ", "
- set item9 to item9 & the right of sprite whichSprite & ", " & the bottom of sprite whichSprite & RETURN
- end if
- put item1 & item2 & item3 & item4 & item5 & item6 & item7 & item8 & item9
- end if
- end
-
- on ! whichSprite
- if value(whichSprite) > 0 then
- if the type of sprite whichSprite = 0 then
- put "Cursor location: " & point(the mouseH, the mouseV)
- put "There is no sprite in channel " & whichSprite & "."
- else
- put "Cursor location: " & point(the mouseH, the mouseV)
- set item1 to "Cursor location, relative to the top left corner of sprite " & whichSprite & ": "
- set item2 to point(the mouseH - the left of sprite whichSprite, the mouseV - the top of sprite whichSprite)
- put item1 & item2
- end if
- else
- put "Cursor location: " & point(the mouseH, the mouseV)
- end if
- end
-
- on setActivateScript whichSprite, whichSprite2
- if the type of sprite whichSprite = 0 then
- set activateScript to "nothing"
- else
- set whichCast to the castNum of sprite whichSprite
- set whichCastName to whichCast
- if the name of cast whichCast > 0 then
- set whichCastName to QUOTE & the name of cast whichCast & QUOTE
- end if
- set item8 to "activate " & whichSprite2 & ", " & whichCastName & ", " & the type of sprite whichSprite & ", " & the ink of sprite whichSprite & ", "
- if the stretch of sprite whichSprite = 0 then
- set item9 to the locH of sprite whichSprite & ", " & the locV of sprite whichSprite & ", "
- set item9 to item9 & QUOTE & QUOTE & ", " & QUOTE & QUOTE & ", " & QUOTE & QUOTE
- else
- set item9 to the left of sprite whichSprite & ", " & the top of sprite whichSprite & ", " & QUOTE & "stretch to:" & QUOTE & ", "
- set item9 to item9 & the right of sprite whichSprite & ", " & the bottom of sprite whichSprite
- end if
- set activateScript to item8 & item9
- end if
- return activateScript
- end
-
- on activate whichSprite, targetCast, targetType, targetInk, targetH, targetV, stretchBool, targetH2, targetV2
- puppetSprite(whichSprite, 1)
- set the type of sprite whichSprite to targetType
- set the castNum of sprite whichSprite to the number of cast targetCast
- set the ink of sprite whichSprite to targetInk
- set the foreColor of sprite whichSprite to 255
- set the backColor of sprite whichSprite to 0
- set the locH of sprite whichSprite to targetH
- set the locV of sprite whichSprite to targetV
- if stretchBool = EMPTY then
- set the stretch of sprite whichSprite to 0
- else
- set the stretch of sprite whichSprite to 1
- if targetH2 <> EMPTY then
- spriteBox(whichSprite, targetH, targetV, targetH2, targetV2)
- end if
- end if
- set the immediate of sprite whichSprite to 1
- end
-
- on deactivate spriteList
- if listp(spriteList) then
- set repeatLimit to count(spriteList)
- repeat with theCount = 1 to repeatLimit
- set whichSprite to getAt(spriteList, 1)
- set the type of sprite whichSprite to 0
- puppetSprite(whichSprite, 0)
- deleteAt(spriteList, 1)
- end repeat
- end if
- end
-
- on store spriteList
- global gStoredSpriteInfo
- if listp(spriteList) then
- if not listp(gStoredSpriteInfo) then
- set gStoredSpriteInfo to []
- end if
- set repeatLimit to count(spriteList)
- repeat with theCount = 1 to repeatLimit
- set x to getAt(spriteList, 1)
- set spriteXinfo to [the type of sprite x]
- if the type of sprite x > 0 then
- append(spriteXinfo, the puppet of sprite x)
- append(spriteXinfo, the castNum of sprite x)
- append(spriteXinfo, the ink of sprite x)
- append(spriteXinfo, the foreColor of sprite x)
- append(spriteXinfo, the backColor of sprite x)
- append(spriteXinfo, the locH of sprite x)
- append(spriteXinfo, the locV of sprite x)
- if the castType of cast the castNum of sprite x = #digitalVideo then
- append(spriteXinfo, the movieTime of sprite x)
- append(spriteXinfo, the movieRate of sprite x)
- end if
- end if
- setAt(gStoredSpriteInfo, x, spriteXinfo)
- deleteAt(spriteList, 1)
- end repeat
- end if
- end
-
- on restore spriteList
- global gStoredSpriteInfo
- if listp(spriteList) then
- if not listp(gStoredSpriteInfo) then
- set gStoredSpriteInfo to []
- end if
- set repeatLimit to count(spriteList)
- repeat with theCount = 1 to repeatLimit
- set x to getAt(spriteList, 1)
- if count(gStoredSpriteInfo) >= x then
- set spriteXinfo to getAt(gStoredSpriteInfo, x)
- if listp(spriteXinfo) then
- set the type of sprite x to getAt(spriteXinfo, 1)
- if getAt(spriteXinfo, 1) > 0 then
- set the puppet of sprite x to getAt(spriteXinfo, 2)
- set the castNum of sprite x to getAt(spriteXinfo, 3)
- set the ink of sprite x to getAt(spriteXinfo, 4)
- set the foreColor of sprite x to getAt(spriteXinfo, 5)
- set the backColor of sprite x to getAt(spriteXinfo, 6)
- set the locH of sprite x to getAt(spriteXinfo, 7)
- set the locV of sprite x to getAt(spriteXinfo, 8)
- if count(spriteXinfo) >= 10 then
- set the movieTime of sprite x to getAt(spriteXinfo, 9)
- set the movieRate of sprite x to getAt(spriteXinfo, 10)
- end if
- end if
- end if
- end if
- deleteAt(spriteList, 1)
- end repeat
- end if
- end
-